<template>
    <div>
        <Row >
            <Col>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">用户名：</label>
                <Input v-model="username" style="width:200px;"></Input>
            </Row>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">手机号：</label>
                <Input v-model="phone" style="width:200px;"></Input>
            </Row>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">邮箱：</label>
                <Input v-model="email" style="width:200px;"></Input>
            </Row>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">密码：</label>
                <Input v-model="password" style="width:200px;"></Input>
            </Row>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">重复密码：</label>
                <Input v-model="repassword" style="width:200px;"></Input>
            </Row>
            <Row>
                <Button @click="submit">确认</Button>
            </Row>
            </Col>
        </Row>
    </div>

</template>


<script>
import service from '../../service/index.js'
export default {
  name: 'register',
  data() {
    return {
        username:'',
        password:'',
        phone:'',
        email:'',
        repassword:''
    }
  },
  methods:{
      submit(){
          service.post('/v1/register',{
              body:JSON.stringify({
                  username:this.username,
                  password:this.password,
                  email:this.email,
                  phone:this.phone
              })
          })
          .then((res) => {
              console.log(res)
              if(res.retcode === -90002)
              {
                  alert('注册失败')
              }
          })
      }
  }
}
</script>

<style lang="scss" scoped>

</style>